﻿using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.Net;
using System.IO;
using System.Text;
using DGP.Framework.Utils.Drawing;

public partial class Image : System.Web.UI.Page
{
    protected void Page_Load( object sender, EventArgs e )
    {
        try
        {
            Response.Clear();
            Response.ContentType = "image/jpeg";
            Bitmap image = Session[Request.QueryString["ImageID"]] as Bitmap;
            image.Save( Response.OutputStream, ImageFormat.Jpeg );
        }
        catch
        {
        }
    }

    private Bitmap StringToImage( string stream )
    {
        Stream s = new MemoryStream( ASCIIEncoding.Default.GetBytes( stream ) );
        return new Bitmap( s );
    }

}
